/*
 * @Author: tangchuan 1944302118@qq.com
 * @Date: 2024-02-27 16:22:42
 * @LastEditors: tangchuan 1944302118@qq.com
 * @LastEditTime: 2024-03-27 16:29:11
 * @FilePath: \jeecg-novel\src\views\order\orderList\MealOrder.data.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '订单号',
    align: 'center',
    dataIndex: 'transactionId',
  },
  {
    title: '充值金额',
    align: 'center',
    dataIndex: 'payMoney',
    customRender: ({ text }) => {
      return '$' + text;
    },
  },
  {
    title: '充值用户',
    align: 'center',
    dataIndex: 'userName',
  },
  {
    title: '会员邮箱',
    align: 'center',
    dataIndex: 'email',
  },
  {
    title: '订单状态',
    align: 'center',
    dataIndex: 'orderStatus',
    customRender: ({ text }) => {
      let str = '';
      if (text === 0) {
        str = '待支付';
      } else if (text === 1) {
        str = '已支付';
      } else if (text === 2) {
        str = '取消支付';
      } else if (text === 3) {
        str = '扣款失败';
      }
      return str;
    },
  },
  {
    title: '订单日期',
    align: 'center',
    dataIndex: 'createTime',
  },
  {
    title: '支付平台',
    align: 'center',
    dataIndex: 'type',
    customRender: ({ text }) => {
      return text == 1 ? 'paypal' : 'stripe';
    },
  },
];
columns.forEach((item) => {
  item.resizable = true;
});
//查询数据
export const searchFormSchema: FormSchema[] = [];

//表单数据
export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
